
/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2017原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.aop;

import org.aopalliance.aop.Advice;

/**
 * Base interface holding AOP <b>advice</b> (action to take at a joinpoint)
 * and a filter determining the applicability of the advice (such as
 * a pointcut). <i>This interface is not for use by Spring users, but to
 * allow for commonality in support for different types of advice.</i>
 *
 * <p>Spring AOP is based around <b>around advice</b> delivered via method
 * <b>interception</b>, compliant with the AOP Alliance interception API.
 * The Advisor interface allows support for different types of advice,
 * such as <b>before</b> and <b>after</b> advice, which need not be
 * implemented using interception.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 */
/**
 *保存AOP＜b＞建议的基本接口＜/b＞（在连接点采取的操作）
 *以及确定建议的适用性的过滤器（例如
 *切入点）<i> 此接口不供Spring用户使用，但用于
 *允许支持不同类型建议的通用性</我>
 *
 *＜p＞Spring AOP基于＜b＞通过方法提供的建议＜/b＞
 *<b>拦截</b>，符合AOP联盟拦截API。
 *Advisor接口允许支持不同类型的建议，
 *例如</b>之前的<b>和</b>建议之后的<b></b>
 *使用拦截实现。
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 */
public interface Advisor {

	/**
	 * Common placeholder for an empty {@code Advice} to be returned from
	 * {@link #getAdvice()} if no proper advice has been configured (yet).
	 * @since 5.0
	 */
	/**
	 *要从中返回的空｛@code Advice｝的公共占位符
	 *｛@link#getAdvice（）｝，如果尚未配置正确的建议。
	 *@自5.0
	 */
	Advice EMPTY_ADVICE = new Advice() {};


	/**
	 * Return the advice part of this aspect. An advice may be an
	 * interceptor, a before advice, a throws advice, etc.
	 * @return the advice that should apply if the pointcut matches
	 * @see org.aopalliance.intercept.MethodInterceptor
	 * @see BeforeAdvice
	 * @see ThrowsAdvice
	 * @see AfterReturningAdvice
	 */
	/**
	 *返回此方面的建议部分。建议可能是
	 *拦截器、预处理建议、抛出建议等。
	 *@返回切入点匹配时应应用的建议
	 *@请参见org.opalliance.intercept.MethodInterceptor
	 *@参见BeforeAdvice
	 *@参见ThrowsAdvice
	 *@参见AfterReturningAdvice
	 */
	Advice getAdvice();

	/**
	 * Return whether this advice is associated with a particular instance
	 * (for example, creating a mixin) or shared with all instances of
	 * the advised class obtained from the same Spring bean factory.
	 * <p><b>Note that this method is not currently used by the framework.</b>
	 * Typical Advisor implementations always return {@code true}.
	 * Use singleton/prototype bean definitions or appropriate programmatic
	 * proxy creation to ensure that Advisors have the correct lifecycle model.
	 * @return whether this advice is associated with a particular target instance
	 */
	/**
	 *返回此建议是否与特定实例关联
	 *（例如，创建mixin）或与
	 *从同一家Spring bean工厂获得的建议类。
	 *＜p＞＜b＞请注意，框架当前未使用此方法</b>
	 *典型的Advisor实现总是返回｛@code true｝。
	 *使用单例/原型bean定义或适当的编程
	 *创建代理以确保Advisors具有正确的生命周期模型。
	 *@return此建议是否与特定目标实例关联
	 */
	boolean isPerInstance();

}
